﻿using System;
using System.Collections.Generic;
using System.Text;

namespace KBEngine
{
    public class Logger
    {
        public enum LogType { D, W, E }
        public static event Action<LogType, object> LogProxy;

        public static void Log(object obj)
        {
#if DEBUG
            System.Diagnostics.Debug.WriteLine("[I]:" + obj);
#endif
            LogProxy?.Invoke(LogType.D, obj);
        }

        public static void LogWarning(object obj)
        {
#if DEBUG
            System.Diagnostics.Debug.WriteLine("[W]:" + obj);
#endif
            LogProxy?.Invoke(LogType.W, obj);
        }

        public static void LogError(object obj)
        {
#if DEBUG
            System.Diagnostics.Debug.WriteLine("[E]:" + obj);
#endif
            LogProxy?.Invoke(LogType.E, obj);
        }
    }
}
